package com.newbye.operate
{
	import com.newbye.operate.IGraphicable;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;

	public class SelectItemMethods
	{
		// ActionScript file
		public static function selectComponet(dis:DisplayObject):void
		{
			if(null != dis && null != dis.parent)
			{
				var b:SelectBorder = new SelectBorder(dis.width, dis.height);
				b.targetDis = dis;
				if(dis is DisplayObjectContainer)
				{
					(dis as DisplayObjectContainer).addChild(b);
				}
				else
				{
					b.x = dis.x;
					b.y = dis.y;
					dis.parent.addChild(b);
				}
			}
		}
		
		public static function unselectComponet(dis:DisplayObject):void
		{
			SelectBorder.disposeBorderByTarget(dis);
		}
	}
}